Repository navigation
GH-37151: [MATLAB] Use makeValidVariableNames and makeValidDimensionNames in implementation of table method for RecordBatch - #37152
Merged
Conversation
implementation of `table` method for `RecordBatch`.
sgilmore10
approved these changes
Aug 14, 2023
sgilmore10
left a comment
Member
There was a problem hiding this comment.
Thanks for integrating these changes!
Member
Author
|
+1 |
|
After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit b05190e. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them. |
loicalleyne
pushed a commit
to loicalleyne/arrow
that referenced
this pull request
Nov 13, 2023
…imensionNames` in implementation of `table` method for `RecordBatch` (apache#37152) ### Rationale for this change apache#37098 added utilities for making valid MATLAB `table` `VariableNames` (`makeValidVariableNames`) and `DimensionNames` (`makeValidDimensionNames`) from an arbitrary list of strings. This pull request uses these utilities to ensure that `RecordBatch` field names are converted to valid MATLAB `table` `VariableNames`/`DimensionNames` when calling the `table`/`toMATLAB` methods. ### What changes are included in this PR? 1. Used `makeValidVariableNames` and `makeValidDimensionNames` utilities in the implementation of the `table` method for the `RecordBatch` class to ensure that column names are converted to valid MATLAB `table` `VariableNames`/`DimensionNames`. ### Are these changes tested? Yes. 1. The existing tests in `arrow/matlab/test/arrow/tabular/tMakeValidVariableNames.m` and `arrow/matlab/test/arrow/tabular/tMakeValidDimensionNames.m` already test that an arbitrary list of column names are converted into valid MATLAB `table` `VariableNames`/`DimensionNames`. 2. There is currently no straightforward way to create a `RecordBatch` with field names that are invalid MATLAB `VariableNames`/`DimensionNames` using the MATLAB interface. When we have a way to do this in the MATLAB interface, we can add more "integration" tests which verify that a `RecordBatch` with field names that are invalid MATLAB `table` `VariableNames`/`DimensionNames` are converted into valid `VariableNames`/`DimensionNames` when the `table`/`toMATLAB` methods are called. ### Are there any user-facing changes? Yes. A `RecordBatch` with field names that are invalid MATLAB `table` `VariableNames`/`DimensionNames` will now be converted into a MATLAB `table` with valid `VariableNames`/`DimensionNames` when calling the `table`/`toMATLAB` methods. ### Future Directions 1. apache#37046 (this change to the `table` method of the `RecordBatch` class should help preserve the behavior of storing original `RecordBatch` field names in the `VariableDescriptions` property of the output MATLAB `table` returned by `featherread`). * Closes: apache#37151 Authored-by: Kevin Gurney <kgurney@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
#37098 added utilities for making valid MATLAB
tableVariableNames(makeValidVariableNames) andDimensionNames(makeValidDimensionNames) from an arbitrary list of strings.This pull request uses these utilities to ensure that
RecordBatchfield names are converted to valid MATLABtableVariableNames/DimensionNameswhen calling thetable/toMATLABmethods.What changes are included in this PR?
makeValidVariableNamesandmakeValidDimensionNamesutilities in the implementation of thetablemethod for theRecordBatchclass to ensure that column names are converted to valid MATLABtableVariableNames/DimensionNames.Are these changes tested?
Yes.
arrow/matlab/test/arrow/tabular/tMakeValidVariableNames.mandarrow/matlab/test/arrow/tabular/tMakeValidDimensionNames.malready test that an arbitrary list of column names are converted into valid MATLABtableVariableNames/DimensionNames.RecordBatchwith field names that are invalid MATLABVariableNames/DimensionNamesusing the MATLAB interface. When we have a way to do this in the MATLAB interface, we can add more "integration" tests which verify that aRecordBatchwith field names that are invalid MATLABtableVariableNames/DimensionNamesare converted into validVariableNames/DimensionNameswhen thetable/toMATLABmethods are called.Are there any user-facing changes?
Yes.
A
RecordBatchwith field names that are invalid MATLABtableVariableNames/DimensionNameswill now be converted into a MATLABtablewith validVariableNames/DimensionNameswhen calling thetable/toMATLABmethods.Future Directions
featherreadin terms ofarrow.internal.io.feather.Reader#37046 (this change to thetablemethod of theRecordBatchclass should help preserve the behavior of storing originalRecordBatchfield names in theVariableDescriptionsproperty of the output MATLABtablereturned byfeatherread).makeValidVariableNamesandmakeValidDimensionNamesin implementation oftablemethod forRecordBatch#37151